require(quanteda)
source("functions.R")

toks <- readRDS("data_tokens_he.RDS") %>% 
    tokens_lookup(dict_he$keywords)
dfmt <- dfm(toks, remove_padding = TRUE) %>% 
    dfm_group()
dat <- as.data.frame(as.matrix(dfmt) > 0)

saveRDS(dat, "data_dictionary_he.RDS")

